<?php
/* @var $this DepartmentController */
/* @var $dataProvider CActiveDataProvider */

$this->breadcrumbs=array(
	'User Departments',
);

$this->menu=array(
	array('label'=>'Create UserDepartment', 'url'=>array('create')),
	array('label'=>'Manage UserDepartment', 'url'=>array('admin')),
);
?>

<span class="page_h3">CODE</span>

<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'user-grid',
    'dataProvider'=>$dataProvider,
	'columns'=>array( 
		'id', 
		array(
			'name' => 'CODE',
			'value' => '$data->code',
		),
		array(
			'name' => '名称',
			'value' => '$data->name',
		),
		array(
			'name' => '负责人',
			'value' => '$data->manager',
		),
		array(
			'name' => '负责人工号',
			'value' => '$data->manager_unique_id',
		),
		array(            // display a column with "view", "update" and "delete" buttons
            'class'=>'CButtonColumn',
			'template'=>'{update}',
			'buttons'=>array(
				'update' => array(
					'label'=>'修改',     // text label of the button
					'url'=>'Yii::app()->controller->createUrl("department/codeUpdate",array("id"=>$data->primaryKey))',       // a PHP expression for generating the URL of the button
					'imageUrl'=>Yii::app()->request->baseUrl.'/global/img/icons/page_white_edit.png',  // image URL of the button. If not set or false, a text link is used
					'options'=>array('style'=>'cursor:pointer;','target' => '_blank'), // HTML options for the button tag
					'visible'=>'true',
				),
            ),
			
        ),
		), 
		
));
?>
